package com.zj.util;

public enum SexEnum {
    WOMAN(0, "女"), MAN(1, "男"), NONE(2, "未知");
    private Integer code;
    private String msg;

    private SexEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    // 按照状态码返回枚举对象
    public static SexEnum getEmpStatusByCode(Integer code) {
        switch (code) {
            case 0:
                return WOMAN;
            case 1:
                return MAN;
            case 2:
                return NONE;
            default:
                return NONE;
        }
    }
}
